//
// Created by yangchao on 2022/6/4.
// 125. 验证回文串: https://leetcode.cn/problems/valid-palindrome/
//
#include <string>
using namespace std;

class IsPalindrome {
public:
    bool isPalindrome(string s) {
        string sgood;
        for (char ch : s) {
            if (isalnum(ch)) {
                sgood += tolower(ch);
            }
        }
        string sgood_rev(sgood.rbegin(),sgood.rend());
        return sgood == sgood_rev;
    }
};

